﻿using DEL.Sys;
using IBLL.Sys;
using System.Linq;

namespace BLL.Sys
{
    public class UserService : BaseService<User>, IUserService
    {
       
        public override void SetCurrentRepository()
        {
            CurrentRepository = DALFactory.SetUserRepository();

        }

        /// <summary>
        /// 检查用户是存在，用于登录
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>存在返回用户实体，否则返回NULL</returns>
        public User CheckUser(string loginId, string password)
        {
            return GetEntitysByLambda(it => it.LoginId == loginId && it.Password == password).ToList().SingleOrDefault();
        }

    }
   
}
